package com.sxz.sbs.module.staff.presenter;

import com.sxz.sbs.app.App;
import com.sxz.sbs.module.staff.mode.StaffDisposeBean;
import com.sxz.sbs.module.staff.view.StaffDimissionView;
import com.sxz.sbs.rx.RxPresenter;
import com.sxz.sbs.rx.RxSubscriber;
import com.sxz.sbs.rx.RxUtil;

import java.util.HashMap;

/**
 *
 */

public class StaffDimissionPresenter extends RxPresenter<StaffDimissionView>{
    /**
     * 员工离职
     * @param map
     */
    public void staffDimission (HashMap<String,Object> map) {
        addSubscribe(App.getInstance().getApi().staffDimission(map)
                .compose(RxUtil.<String>handleResult())
                .subscribeWith(new RxSubscriber<String>(mView){
                    @Override
                    public void onNext(String data) {
                        mView.onStaffDimissionSuccess();
                    }
                })
        );
    }
}
